<?php

    /*
        Smarty.php, setup Smarty with the given config
    */

    require_once('http.php');
    require_once('smarty/SmartyML.php');

    setlocale(LC_TIME,'tr_TR.UTF8');

    $smarty = new smartyML($_SESSION['AL']);

    $smarty->template_dir   = $CF['Sys']['Path'].'themes/'.$CF['Sys']['Theme'];
    $smarty->plugins_dir    = array($CF['Sys']['Path'].'lib/smarty/plugins');
    $smarty->cache_dir      = $CF['Sys']['Path'].$CF['Sys']['Temp'];
    $smarty->caching        = $CF['Sys']['TemplateCaching'];
    $smarty->compile_dir    = $CF['Sys']['Path'].$CF['Sys']['Temp'];
    $smarty->force_compile  = $CF['Sys']['ForceCompile'];

    $smarty->clear_all_cache();

    function ssv($varname, $var){
        global $smarty;
        $smarty->assign($varname,$var);
    }

    ssv('path',$CF['Sys']['Path']);
    ssv('url',$CF['Sys']['Url']);
    ssv('tp',$CF['Sys']['Url'].'/themes/'.$CF['Sys']['Theme']);
    ssv('al',$_SESSION['AL']);
    ssv('ProjectTitle',$CF['Project']['Title']);

?>
